dwSize As Long ' Size in bytes of RASCONN Structure (30)
hrasconn As Long ' handle to connection
szEntryName As String * RAS_MaxEntryNamePlus1 'name or "" followed by phone #
szFiller As String * 1 'must end on word (2-byte) boundary
End Type
'Equiv of _RASCONNSTATE enumerated type
Global Const RAS_OpenPort = 0
Global Const RAS_PortOpened = 1
Global Const RAS_ConnectDevice = 2
Global Const RAS_DeviceConnected = 3
Global Const RAS_AllDevicesConnected = 4
Global Const RAS_Authenticate = 5
Global Const RAS_AuthNotify = 6
Global Const RAS_AuthRetry = 7
Global Const RAS_AuthCallback = 8
Global Const RAS_AuthChangePassword = 9
Global Const RAS_AuthProject = 10
Global Const RAS_AuthLinkSpeed = 11
Global Const RAS_AuthAck = 12
Global Const RAS_ReAuthenticate = 13
Global Const RAS_Authenticated = 14
Global Const RAS_PrepareForCallback = 15
Global Const RAS_WaitForModemReset = 16
Global Const RAS_WaitForCallback = 17
Global Const RAS_Interactive = RASCS_PAUSED
Global Const RAS_RetryAuthentication = RASCS_PAUSED + 1
Global Const RAS_CallbackSetByCaller = RASCS_PAUSED + 2
Global Const RAS_PasswordExpired = RASCS_PAUSED + 3
Global Const RAS_Connected = RASCS_DONE
Global Const RAS_Disconnected = RASCS_DONE + 1
'End _RASCONNSTATE declarations
Type RASCONNSTATUS
dwSize As Long ' size of struct in bytes (60)
rasconnstate As Integer ' one of RASCONNSTATE enum types
dwError As Long ' reason for fail if non-zero
szDeviceType As String * RAS_MaxDeviceTypePlus1 'current dev type
szDevicename As String * RAS_MaxDeviceNamePlus1 'current dev name
End Type
Type RASDIALPARAMS
dwSize As Long ' size of struct (256, calculates to 255)
szEntryName As String * RAS_MaxEntryNamePlus1
szPhoneNumber As String * RAS_MaxPhoneNumberPlus1
szCallbackNumber As String * RAS_MaxCallbackNumberPlus1
szUserName As String * UNLENPlus1
szPassword As String * PWLENPlus1
szDomain As String * DNLENPlus1
szFiller As String * 1
End Type
Type RASENTRYNAME
dwSize As Long ' size of struct (26)
szEntryName As String * RAS_MaxEntryNamePlus1
szFiller As String * 1
End Type
'Declare RASAPI16.DLL external functions
Declare Function RASDIAL& Lib "RASAPI16.DLL" (reserved As Any, lpszPhonebookPath As Any, lprasdialparams As RASDIALPARAMS, reserved2 As Any, ByVal hwndNotifier As Integer, lphrasconn As Long)
'LPTSTR reserved; /* reserved; must be set to NULL*/
'LPTSTR lpszPhonebookPath; /* full pathname to Phone Book file*/
'LPRASDIALPARAMS lpRasDialParams; /* points to calling parameters*/
'LPVOID reserved2; /* reserved; must be set to NULL*/
'HWND hwndNotifier; /* notification message for RasDial events*/
'LPHRASCONN lphrasconn; /* points to variable to receive connection handle*/
Declare Function RasEnumConnections& Lib "RASAPI16.DLL" (lprasconn As RASCONN, lpcb&, lpcConnections&)
'LPRASCONN lprasconn; /* buffer to receive connections data */
'LPDWORD lpcb; /* size in bytes of buffer */
'LPDWORD lpcConnections; /* number of connections written to buffer */
'Following function is not currently used by RASAPIVB
'Declare Function RasEnumEntries& Lib "RASAPI16.DLL" (reserved As Any, lpszPhonebookPath As Any, lprasentryname As RASENTRYNAME, lpcb As Long, lpcEntries As Long)
'LPTSTR reserved; /* reserved; must be NULL */
'LPTSTR lpszPhonebookPath; /* full path to Phone Book file */
'LPRASENTRYNAME lprasentryname; /* buffer to receive Phone Book entries */
'LPDWORD lpcb; /* size in bytes of buffer */
'LPDWORD lpcEntries; /* number of entries written to buffer */
Declare Function RasGetConnectStatus& Lib "RASAPI16.DLL" (ByVal hrasconn&, lprasconnstatus As RASCONNSTATUS)
'HRASCONN hrasconn; /* handle to Remote Access connection of interest */
'LPRASCONNSTATUS lprasconnstatus; /* buffer to receive status data */